<?php 
	class Cutsize extends CI_Controller
	{
		public function index()
		{
			$this->load->view('template/template');
			$this->load->view('setting/CutSize');
			$this->load->view('template/footer');
		}
		public function output()
		{
			$inputData = array(
								"form_id"=>"2",
								"type_of"=>$this->input->post("cutsize1"),
								"gram"=>$this->input->post("cutsize2"),
								"size"=>$this->input->post("cutsize6"),
								//"brand"=>$this->input->post("cutsize3"),
								//"gram"=>$this->input->post("masterMR4"),
								"grade"=>$this->input->post("cutsize4"),
								//"problem"=>$this->input->post("cutsize5"),
								"shift"=> $this->input->post('cutsize10'),
								//"lot_no"=>$this->input->post("cutsize7"),						 
								//"modify_date"	=>date("Y-m-d H:i:s"),
								//"position"=> $this->input->post('cutsize8'),//cutsize1
								//"date"=> $this->input->post('cutsize9'),
								//"time" =>$this->input->post('cutsize11'),
								//"roll_id1"=> $this->input->post('cutsize12'),
								//"roll_id2"=> $this->input->post('cutsize13'),
								//"roll_id3"=> $this->input->post('cutsize14'),
								//"roll_id4"=> $this->input->post('cutsize15'),
								//"roll_id5"=> $this->input->post('cutsize16'),
								//"start_date"=>$this->input->post('cutsize9'),
								//"end_date"=>,
								//"modify_date"=>,
								"modify_user"=>"10001",
								"status"=>"1"
								
				);
				$inputAllData=array();
			 	for($i=17;$i<=66;$i++)
				{
			 		$data= array();
			 		
			 		$data = array(
			 						"data_name"=> "CutSize".$i,
			 						"value_start"=> $this->input->post("cutsize".$i."_1"),
									"value_end"=>$this->input->post("cutsize".$i."_2")
			 						
			 					);
			 		$inputAllData[]=$data;
			 	}
				
				echo $this->cutsize_model->checkCutsize($inputAllData,$inputData);
		}
		public function checkCutsize()
		{
			{
				$inputData = array(
								"form_id"=>"2",
								"type_of"=>$this->input->post("cutsize1"),
								"gram"=>$this->input->post("cutsize2"),
								"size"=>$this->input->post("cutsize6"),
								//"brand"=>$this->input->post("cutsize3"),
								//"gram"=>$this->input->post("masterMR4"),
								"grade"=>$this->input->post("cutsize4"),
								//"problem"=>$this->input->post("cutsize5"),
								"shift"=> $this->input->post('cutsize10'),
								//"lot_no"=>$this->input->post("cutsize7"),						 
								//"modify_date"	=>date("Y-m-d H:i:s"),
								//"position"=> $this->input->post('cutsize8'),//cutsize1
								//"date"=> $this->input->post('cutsize9'),
								//"time" =>$this->input->post('cutsize11'),
								//"roll_id1"=> $this->input->post('cutsize12'),
								//"roll_id2"=> $this->input->post('cutsize13'),
								//"roll_id3"=> $this->input->post('cutsize14'),
								//"roll_id4"=> $this->input->post('cutsize15'),
								//"roll_id5"=> $this->input->post('cutsize16'),
								//"start_date"=>$this->input->post('cutsize9'),
								//"end_date"=>,
								//"modify_date"=>,
								"modify_user"=>"10001",
								"status"=>"1"
							);
				$text = "";
			 	$inputAllData=array();
			 	for($i=17;$i<=66;$i++){
			 		$data= array();
			 		//$text = $text." $i ".$this->input->post("masterMR".$i."_1")." ". $this->input->post("masterMR".$i."_2")."\n";
			 		$data = array(
			 						"data_name"=> "CutSize".$i,
			 						"data_value"=> $this->input->post("cutsize".$i."_1"),
									
			 					);
			 		$inputAllData[]=$data;
			 	}
				
				echo $this->cutsize_model->keyIncutsize($inputData,$inputAllData);
				//echo $this->input->post("input1")." ".$this->input->post("input2")." ".$this->input->post("input3")." ".$this->input->post("input4");
				
			}
		}
		
	}
?>